<template>
    <div class="dialoglistDiv">
        <div class="dialogsearchDiv">
            <el-select v-model="obj.req.state" placeholder="是否激活" class="search_select w180px" clearable>
                <el-option v-for="(item,index) in globalData.jihuoTypeList" :key="index" :label="item.text" :value="item.value" />
            </el-select>
            <el-input clearable placeholder="匹配员工姓名" v-model="obj.req.key" class="search_key" />
            <span class="btn search" @click="init">搜索</span>
            <span class="btn refresh" @click="obj.req.currentpage=1;init()"></span>
            <div class="searchRight">
            </div>
        </div>
        <div class="table_box"><div class="table_" id="tb">
            <ul class="head">
                <li class="">昵称</li>
                <li class="wcen">联系方式</li>
                <li class="wcen">登录次数</li>
                <li class="wcen">最后登录时间</li>
            </ul>
            <div class="body">
                <ul v-for="x in obj.ary" :key="x">
                    <li class="">{{x.name}}</li>
                    <li class="wcen">{{x.mobile}}</li>
                    <li class="wcen">{{x.loginnum}}</li>
                    <li class="wcen">{{x.lastlogintime}}</li>
                </ul>
            </div>
        </div>
        </div><Pager :value="obj.req" :init="init" />
    </div>
</template>

<script setup>
    import { reactive, getCurrentInstance, ref, toRefs, provide, computed,inject } from 'vue'
    import Pager from '@/components/pager.vue'
    let { proxy } = getCurrentInstance()

    let obj = reactive({
        ary: [
            {id:1,name:"穿山丙",intime:"2020-03-06 11:23:33",lastlogintime:"2020-03-10 09:33:21"}
        ],
        req: {
            "garden_id": inject("id").value || 0,
            "key":"",
            "state":"",
            currentpage: 1,
            pagesize: 10,
            count: 0,
        }
    });
    let init = () => {
        proxy.$ajax({
            url: '/mp_gardenList/property',
            data: obj.req,
            bfLoading: true
        }).then(d => {
            // console.log(d)
            if(d.success){
                obj.ary = d.msg.list
                obj.req.count = d.msg.count
            }
        }).catch(() => { })
    }

</script>

<style scoped>
    ::-webkit-scrollbar { width:10px; background-color: #FFFFFF; }
    .listDiv { top:70px; }
    #tb ul li.li2 { width: 100px; }
    #tb ul li.li3 { width: 100px; }
    #tb ul li.li4 { width: 45px; }
</style>